'''
装饰器装饰通用性最终版  有返回值情况
一旦方法上有装饰器  那么它执行的是inner
'''


def wrapper1(fn):
    def inner(*args, **kwargs):  # 任意参数都能接受 ("admin":"123546")  ("大佬")
        print("wapper1-before")
        ret = fn(*args, **kwargs)
        print("wapper1-after")
        return ret

    return inner


def wrapper2(fn):
    def inner(*args, **kwargs):  # 任意参数都能接受 ("admin":"123546")  ("大佬")
        print("wapper2-before")
        ret = fn(*args, **kwargs)
        print("wapper2-after")
        return ret

    return inner


def wrapper3(fn):
    def inner(*args, **kwargs):  # 任意参数都能接受 ("admin":"123546")  ("大佬")
        print("wapper3-before")
        ret = fn(*args, **kwargs)
        print("wapper3-after")
        return ret

    return inner


@wrapper3
@wrapper2
@wrapper1
def target():
    print("what")


target()

'''
wapper3-before
wapper2-before
wapper1-before
what
wapper1-after
wapper2-after
wapper3-after
'''


